﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class DatVe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {        
        if (!Page.IsPostBack)
        {
            //QLVe v = new QLVe();
            //ddlDiemdi.DataSource = v.getAllTinh();
            //ddlDiemdi.DataBind();
            //ddlDiemden.DataSource = v.getAllTinh();
            //ddlDiemden.DataBind();
            loadTinh();
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        
    }

    public void loadTinh()
    {
        ConnectionDB db = new ConnectionDB();
        db.Cmd.CommandText = "select * from TinhThanh";
        SqlDataAdapter adap = new SqlDataAdapter(db.Cmd);
        DataSet ds = new DataSet();
        adap.Fill(ds);
        ddlDiemden.DataSource = ds;
        ddlDiemden.DataTextField = "ten_tinhthanh";
        ddlDiemden.DataValueField = "ma_tinhthanh";
        ddlDiemden.DataBind();

        ddlDiemdi.DataSource = ds;
        ddlDiemdi.DataTextField = "ten_tinhthanh";
        ddlDiemdi.DataValueField = "ma_tinhthanh";
        ddlDiemdi.DataBind();
    }
}